{% extends "base.jinja" %}

{% block pagetype %}post{% endblock %}

{% block css %},main.css{% endblock %}

{% block main %}
	<div class="layout mt-crumb">
        <a href="/">首页</a>&nbsp;>&nbsp;<a target="_blank" href="/share/detail/all/{{base_data.id}}/" title="{{base_data.title}}">{{base_data.title|cut_str(60)}}</a>&nbsp;>&nbsp;<b>编辑灵感</b>
    </div>

	<div class="layout page" id="p-post">
		<div class="post-main">
			<form method="post" action="">
				<input type="hidden" id="share-id" name="shareid" value="{{base_data.id}}" />
				<input type="hidden" name="cover" value="" id="cover" />
				<div class="p-upload p-upload-hasload" id="p-upload" data-error="→_→ 无图无真相,0,-48">
					<p class="p-empty-tips">还没有插入图片 <span>Tips: 支持按住Ctrl多选上传图片，图片控制在2M以内</span></p>
					<ul class="pu-main">
						{% for ext in ext_data %}
						<li class="upload-item upload-done" data-old="true">
							<input type="hidden" class="upload-image" name="images_id" value="{{ext.image.id}}">
							<div class="ui up-cancel" href="javascript:;">删除</div>
							<div class="up-data {% if ext.image.is_cover %} up-data-cover{% endif %}" data-mid="{{ext.image.id}}">
								<a class="ui up-cover" alt="设为封面" href="javascript:;"></a>
								<img width="260" src="{{ext.image.path}}!260x260" >
							</div>
							<ul class="up-tag">
								{% if ext.tags %}
									{% for tag in ext.tags %}
									<li class="ui-a tag-item">{{tag}}</li>
									{% endfor %}
		                        	<li><input class="inp-text" type="text" name="tags" /></li>
		                        {% else %}
									<li><input class="inp-text" type="text" name="tags" placeholder="无标签" /></li>
		                        {% endif %}
		                    </ul>
							<div class="up-color">
		                        {% for col in ext.colors %}
		                        	<span data-cid="{{col.id}}" class="cpi-{{col.id}}" alt="{{col.name}}" style="background:{{col.value}}"></span>
		                        {% endfor %}
								<a class="ui up-color-btn" href="javascript:;" alt="选择颜色"></a>
							</div>
						</li>
						{% endfor %}
						<li class="upload-item up-add"><span class="up-add-btn"></span></li>
					</ul>
				</div>
				<div class="error-tips"><span></span></div>
				<div class="pm-tags" id="pm-tags"></div>
				<div class="pm-color" id="pm-color">
					{% for color in colors %}
						<a href="javascript:;" data-color="{{color.color}}" data-id="{{color.id}}"
					   style="background-color:{{color.color}}" class="ui-a" title="{{color.name}}"></a>
					{% endfor %}
				</div>

				<div class="pm-cont">
					<div class="pm-cont-title">
						<input autocomplete="off" data-error="写个标题吧,-11,-60" class="inp-text pm-title" type="text" name="title" value="{{base_data.title|forceescape}}" placeholder="输入标题" />
					</div>
					<div class="pm-cont-box">
						<div class="edit-bar" id="edit-bar">
				            <div class="ed-bold" title="加粗"></div>
				            <div class="ed-italic" title="斜体"></div>
				            <div class="ed-link" id="link" title="连接"></div>
				            <div class="ed-unlink" title="取消连接"></div>
				            <div class="ed-format" title="清除格式"></div>
				        </div>
				        <textarea id="edit_holder" class="inp-atext edit_holder">{{base_data.content}}</textarea>
					</div>
				</div>

				<div class="pm-btn"><a class="inp-btn-pk-m post-btn" href="javascript:;">发布</a></div>
			</form>
		</div>
		<div class="post-sub">
			<dl class="cus-select p-secate" id="p-secate" data-error="没选择类目呢,0,-48">
				<input type="hidden" autocomplete="off" name="cate-id" id="cate-id" value="{{base_data.cate_id}}" />
				<dt class="ui-a">{{base_data.cate.name}}</dt>
	            <dd>
	            	<ul>
	            		{% for cate in cate_data %}
							<li><a href="javascript:;"  data-cid="{{cate.id}}">{{cate.name}}</a></li>
						{% endfor %}
	            	</ul>
	            </dd>
	        </dl>

	        {% if is_supplier %}

			<div class="p-scheduled">
				<label class="inp-checkbox">
					<input type="checkbox" name="scheduled-enable" value="1" {% if base_data.scheduled_enbale %}checked="checked"{% endif %} />可预定
				</label>
			</div>
			{% endif %}

			<div class="post-sub-collect"><a href="{{domain}}site/collection/" target="_blank">安装采集工具></a></div>
		</div>
	</div>
{% endblock %}

{% block script %}
<script src="http://s.lovewith.me/static/js/page/post/edit/ueditor.all.min.js"></script>
<script src="http://s.lovewith.me/static/js/page/post/edit/ueditor.config.js"></script>
<script>seajs.use('page/post-image', function(p){p.render()});</script>
{% endblock %}
